home *** CD-ROM | disk | FTP | other *** search
- 'Tree Masacre - Copyright 1988 by Mark Botta
- 'Written 6/88 using Microsoft QuickBASIC v4.00
- '
- 'Requires EGA adapter
- '
- 'Level is the number of trees on the screen at once (The higer Level is the
- 'more difficult the game). This number cannot exceed Tree.max. Level can be
- 'modified durring game play, but Tree.max should not be.
-
-
- SCREEN 9 'Change to EGA high-res
-
- CONST Size = 1000 'Size of graphics arrays
- CONST Left = 1 'Graphic array
- CONST Strt = Size + 1 ' position of
- CONST Right = 2 * Size + 1 ' skiier images
- CONST Tree.max = 7 'Max number of trees
-
- Level = Tree.max 'Max num of trees on screen
- ' at once
- High = 0 'Init high score
-
-
- DIM Tree(1 TO Size), Man(1 TO Size * 3), Blank(1 TO Size)
- DIM Tree.pos(Tree.max), Down(Tree.max)
-
-
- '-- LOAD FROM FILES TO THE ARRAYS --
-
- DEF SEG = VARSEG(Blank(1))
- BLOAD "BLANK.IMG", VARPTR(Blank(1))
-
- DEF SEG = VARSEG(Tree(1))
- BLOAD "TREE.IMG", VARPTR(Tree(1))
-
- DEF SEG = VARSEG(Man(Left))
- BLOAD "GUYL.IMG", VARPTR(Man(Left))
-
- DEF SEG = VARSEG(Man(Strt))
- BLOAD "GUY.IMG", VARPTR(Man(Strt))
-
- DEF SEG = VARSEG(Man(Right))
- BLOAD "GUYR.IMG", VARPTR(Man(Right))
- DEF SEG
-
-
-
- START:
-
- CLS
- LINE (0, 0)-(205, 349), 1, BF
- LINE (445, 0)-(639, 349), 1, BF
-
- LOCATE 1, 3: PRINT "(C) 1988 By Mark Botta"
- LOCATE 13, 5: PRINT "TREE MASACRE"
- LOCATE 14, 5: PRINT "By Mark Botta"
- LOCATE 23, 5: PRINT "ESC to Quit"
-
-
- '-- Initialize variables --
-
- dX = 0 'Initial distance incrament
- X = 320 'Initial man position
- Dir = Strt 'Initial dir (straight)
- Score = 0 'Current game score
-
- FOR Trees = 1 TO Tree.max
- Down(Trees) = -1
- NEXT Trees
-
-
- '-- Main loop --
-
- DO
- LOCATE 13, 60: PRINT "Score: "; Score
- LOCATE 1, 60: PRINT "High Score: "; High
-
- PUT (X, 270), Man(Dir), PSET 'Put man in new loc.
-
- FOR Trees = 1 TO Level
- IF Down(Trees) > -1 THEN 'If tree is on screen
- Down(Trees) = Down(Trees) + 10 'Incrament tree movement
- PUT (Tree.pos(Trees), Down(Trees)), Tree, PSET
-
- IF Down(Trees) = 310 THEN 'End of screen
- PUT (Tree.pos(Trees), Down(Trees)), Blank, PSET
- Down(Trees) = -1 'Toggle to off-screen
-
- ELSEIF (Down(Trees) = 250) THEN 'Check for impact or score
- IF (X > Tree.pos(Trees) - 17) AND (X < Tree.pos(Trees) + 20) THEN
- Score = 0
- LOCATE 2, 37: PRINT "BLAMMO!"
- SOUND 37, 5
- FOR Delay = 1 TO 1000: NEXT Delay
- GOTO START
-
- ELSE
- Score = Score + 1
- IF Score > High THEN High = Score
- END IF
- END IF
-
- ELSEIF (INT(RND * 10) < 2) THEN
- Down(Trees) = 0 'Toggle to on-screen status
- Tree.pos(Trees) = INT(191 * RND) + 210 'Random pos. within bounds
- END IF
- NEXT Trees
-
- Pressed$ = INKEY$
- SELECT CASE Pressed$
- CASE "4": 'Left
- Dir = Left: dX = -5
- CASE "5": 'Straight
- Dir = Strt: dX = 0
- CASE "6": 'Right
- Dir = Right: dX = 5
- CASE ELSE
- END SELECT
-
- X = X + dX 'Incrament man's location
- IF X = 205 THEN X = 210 'Limit left border
- IF X = 405 THEN X = 400 'Limit right border
-
- LOOP UNTIL Pressed$ = CHR$(27) 'Exit when ESC is pressed
-
-